﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Uber.Messages;

namespace Uber.HabboHotel.Achievements
{
    class Achievement
    {
        public uint Id;
        public int Levels;
        public string BadgeCode;
        public int PixelBase;
        public double PixelMultiplier;
        public bool DynamicBadgeLevel;
        public bool EnableCounter;

        public Achievement(uint mId, int mLevels, string mBadgeCode, int mPixelBase, double mPixelMultiplier, bool mDynamicBadgeLevel, bool mEnableCounter)
        {
            this.Id = mId;
            this.Levels = mLevels;
            this.BadgeCode = mBadgeCode;
            this.PixelBase = mPixelBase;
            this.PixelMultiplier = mPixelMultiplier;
            this.DynamicBadgeLevel = mDynamicBadgeLevel;
            this.EnableCounter = mEnableCounter;
        }

        public void Serialize(ServerMessage Message, Int32 Pixels, Int32 Level, String Badge)
        {
            Message.AppendUInt(Id);
            Message.AppendInt32(Level);
            Message.AppendStringWithBreak(Badge);
            Message.AppendInt32(1); // need
            Message.AppendInt32(Pixels);
            Message.AppendBoolean(!EnableCounter);
            Message.AppendInt32(0); //got
        }
    }
}
